Chapter 11
Comparing Average Values between Groups
IN THIS CHAPTER
Determining which tests should be used in different situations
Preparing your data, running tests, and interpreting the output
Estimating the sample size you need to compare average values
Comparing average values between groups of numbers is part of almost all biostatistical analyses, and
over the years, statisticians have developed dozens of tests for this purpose. These tests include
several different flavors of the Student t test, analyses of variance (ANOVA), and a dizzying collection
of tests named after the men who popularized them, including Welch, Wilcoxon, Mann-Whitney, and
Kruskal-Wallis, to name just a few. The multitude of tests is enough to make your head spin, which
leaves many researchers with the uneasy feeling that they may be using the wrong statistical test on
their data.
In this chapter, we guide you through the menagerie of statistical tests for comparing groups of
numbers. We start by explaining why there are so many tests available, then guide you as to which ones
are right for which situations. Next, we show you how to execute these tests using R software, and how
to interpret the output. We focus on tests that are usually provided by modern statistical programs (like
those discussed in Chapter 4, which also explains how to install and get started with R).
Grasping Why Different Situations Need Different
Tests
You may wonder why there are so many tests for such a simple task as comparing averages. Well,
“comparing averages” doesn’t refer to a specific situation. It’s a broad term that can apply to different
situations where you are trying to compare averages. These situations can differ from each other on the
basis of these and other factors, which are listed here in order of most to least common:
Within or between: You could be testing differences within groups or differences between
groups.
Number of time points: You could be testing differences occurring at one point or over a number
of time points.
Number of groups: You could be testing differences between two groups or between three or
more groups.
Distribution of outcome: Your outcome measurement could follow the normal distribution or
some other distribution (see Chapter 3).
Variation: You could be testing the differences in variation or spread across groups (see Chapter